import os
import shutil

paths = ['C:\Windows\SoftwareDistribution\Download',
         'C:\Windows\System32\LogFiles',
         'C:\Windows\System32\Temp',
         'C:\Windows\Prefetch',
         "C:\\Users\\m1761\AppData\Local\Temp",
         "C:\\KwDownload\\Temp", # 酷我缓存
         "D:\\KwDownload\\Temp", # 酷我缓存
         # 微信数据
         "C:\\Users\\m1761\Documents\WeChat Files\wxid_ztj8q4m85g9722",
         ]


def rm(path):
    if os.path.exists(path):
        if os.path.isdir(path):
            try:
                shutil.rmtree(path)
            except:
                try:
                    for _ in os.listdir(path):
                        rm(os.path.join(path, _))
                except:
                    pass

        elif os.path.isfile(path):
            try:
                os.remove(path)
                print('删除文件：' + path)
            except:
                pass


for path in paths:
    rm(path)
